﻿@inherits Vowei.Web.G18nWebViewPage<Vowei.Core.Models.Project>
@using System.Web.Mvc.Html
@using Vowei.Core.Models;
@using Vowei.Web.Helpers;
@{
    ViewBag.Title = Model.Title;
}
<h2>@string.Format(T("{0} 详细信息"), @Model.Title)</h2>
<fieldset>
    <legend>@T("详细信息")</legend>
    <div class="display-label">@T(model => model.Title)</div>
    <div class="display-field">@Model.Title</div>
    <div class="display-label">@T(model => model.Owner)</div>
    <div class="display-field">@Model.Owner</div>
    <div class="display-label">@T("状态")</div>
    <div class="display-field">@Model.Status</div>
    <div class="display-label">@T("进度")</div>
    <div class="display-field">@Model.Progress</div>
    <div class="display-label">@T(model => model.StartDate)</div>
    <div class="display-field">@T(Model.StartDate)</div>
    <div class="display-label">@T(model => model.DueDate)</div>
    <div class="display-field">@T(Model.DueDate)</div>
    <div class="display-label">@T(model => model.ClosedDate)</div>
    <div class="display-field">@T(Model.ClosedDate)</div>
    <p>
        <a href="/Requirement/Index/?pid=@Model.ID">@T("需求列表")</a>
    </p>
</fieldset>
@Html.Partial("_MilestonePartial", Model)
<fieldset>
    <legend>@T("项目组成员")</legend>
    <ul>
        @foreach (var user in (Vowei.Core.Models.Employee[])ViewData["Members"])
        {
            var displayName = user.DisplayName;
            if (string.IsNullOrEmpty(displayName))
            {
                displayName = user.Email;
            }

            <li><a href="/Account/Details/@Server.UrlEncode(user.Email)">@displayName</a></li>
        }
    </ul>
</fieldset>
<p>
    @Html.ActionLink(T("编辑"), "Edit", new { id = Model.ID }) |
    @Html.ActionLink(T("返回项目列表"), "Index") |
    @Html.ActionLink(T("创建需求"), "CreateIn", "Requirement", new { project = Model.ID }, null)
    |
    @Html.ActionLink(T("创建任务"), "CreateIn", "Task", new { project = Model.ID }, null)
    |
    @Html.ActionLink(T("导入任务"), "ImportProjectTasks", "Wizard", new { id = Model.ID }, null)
    | <a href="/Account/ImportUsers/?pid=@Model.ID">@T("从Excel导入团队成员")</a> | <a href="/Account/AddUserTo/?pid=@Model.ID">@T("添加新成员")</a>
</p>
<p>
    @Html.ActionLink(T("进度信息"), "ScheduleDetails", new { id = Model.ID }) | <a href="/Project/Timeline/@Model.ID">@T("项目进展")</a>
    | @*<a href="/Statistics/RequirementWorks/?pid=@Model.ID">@T("需求工作量统计")</a> |*@
    <a href="/Statistics/ListTopReq/?pid=@Model.ID">@T("需求工作量统计")</a> | <a href="/Statistics/EarnedValue/?pid=@Model.ID">@T("挣值分析")</a>
    | <a href="/Task/?pid=@Model.ID">@T("所有任务列表")</a> | <a href="/Statistics/ExportProjectTasks/?pid=@Model.ID">@T("导出任务")</a>
    @{
        var stsLink = string.Format("stssync://sts/?ver=1.1&type=tasks&cmd=add-folder&base-url={0}&list-url={1}&guid={2}&site-name=Vowei&list-name={3}"
            , Server.UrlEncode(Request.Url.Scheme + "://" + Request.Url.Host + ":" + Request.Url.Port)
            , Server.UrlEncode("/Lists/id" + Model.ID.ToString("N") + "/")
            , Server.UrlEncode(Model.ID.ToString("B"))
            , Server.UrlEncode(Model.Title));
    }
    <a href="@stsLink">@T("与Outlook相连")</a>
</p>
@Html.Partial("_CommentPartial", Model)